/**
 * Copyright &copy; 2012-2017 <a href="http://minglisoft.cn">HongHu</a> All rights reserved.
 */
package com.honghu.cloud.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.honghu.cloud.bean.Accessory;
import com.honghu.cloud.service.IAccessoryService;

/**
 * 附件Controller
 * @author Administrator
 *
 */
@RestController
@RequestMapping(value = "/accessory")
public class AccessoryController {

	@Autowired
	private IAccessoryService accessoryService;

	
	/**
	 * 根据id查询附件信息
	 * @param congelationDto
	 * @return
	 */
	@RequestMapping(value = "/apiForFeign/selectByPrimaryKey", method = RequestMethod.GET)
	public Accessory selectByPrimaryKey(@RequestParam("id") Long id) {
		return accessoryService.selectByPrimaryKey(id);
	}
	
	
	@RequestMapping(value = "/apiForFeign/saveEntity", method = RequestMethod.POST)
	public void saveEntity(@RequestParam("obj")Accessory obj) {
		accessoryService.saveEntity(obj);
	}
	
	
	/**
	 * 根据商品id查询商品图片集合
	 * @param id 商品id
	 * @return
	 */
	@RequestMapping(value = "/apiForFeign/getGoodsPhotosByAccessoryId", method = RequestMethod.GET)
	List<Accessory> getGoodsPhotosByAccessoryId(@RequestParam("id")Long id){
		return accessoryService.getGoodsPhotosByAccessoryId(id);
	}
	
}